************
*Replication file
* ARTICLE: Is there a first mover advantage in lobbying? A comparative analysis of how the timing of lobbying affects the influence of interest groups in 10 polities

***********

*set WD
*cd "insert_path"
set scheme plotplain

* open File
use "CPS replication dataset"

*********************
*Analyses in the main Article 
*********************

*** Table 1 - OLS regressions explaining organizations' perceived influence on Coronavirus-related policies; with fixed effects for country and clustered standard errors for 13 different sectors
eststo: regress Q20_1 c.timingnew i.Q13_2 i.lobres i.grouptypebin i.insidergov i.age  i.country, vce(cluster sector)
vif

eststo: regress Q20_1 c.timingnew##i.Q13_2  i.insidergov i.grouptypebin i.lobres i.age  i.country, vce(cluster sector)

eststo: regress Q20_1 c.timingnew##i.lobres i.Q13_2  i.insidergov i.grouptypebin i.age  i.country, vce(cluster sector)

esttab using Table.rtf, replace wide nogap onecell cells(b(star fmt(%9.2f)) se(par)) r2(2) ///
		starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001)	///
        legend label collabels(none) 						///
		varlabels(_cons Constant i.lobres "Lobbying Resources" i.grouptype "Organisation Type" Q13 "Affectedness" i.age "Organisation Age" )
eststo clear

*Fig 1 - Predictions of the Level of Lobbying Influence for Early to Late Movers by Level of Affectedness (based on Model 2), with 95% CIs.

/// (Figure is manually adjusted to display estimates only for high and low levels of affectedness)
regress Q20_1 c.timingnew##i.Q13_2  i.insidergov i.grouptypebin i.lobres i.age  i.country, vce(cluster sector)

margins, at(timingnew=(1 2 3 4 5)) over (Q13_2) atmeans
marginsplot, recast(line) title("Early Mover Advantages by Affectedness") xtitle(Timing of Lobbying Activity) recastci(rarea) yline(0)

*Fig 2 - Predictions of the Level of Lobbying Influence for Early to Late Movers by level of resources (based on Model 3), with 95% CIs
regress Q20_1 c.timingnew##i.lobres i.Q13_2  i.insidergov i.grouptypebin i.age  i.country, vce(cluster sector)

margins, at(timingnew=(1 2 3 4 5)) over(lobres) atmeans
marginsplot, recast(line) recastci(rarea) yline(0) title("Early Mover Advantages by Lobbying Staff Resources") xtitle (Timing of Lobbying Activity)

*************
*APPENDIX
*************

*Appendix A - sampling

*Appendix B - question wording

*Appendix C - overview of responses and their distribution (Tables C1-C4)
/// same as in Junk, Crepaz, Hanegraaff, Berkhout, and Aizenberg (2021) For more information, data and do file see http://dx.doi.org/10.1080/13501763.2021.1968936.

****
*Appenidix D - summary statistics and descriptive overview
****

egen Missing2 = rowmiss(Q20_1 timingnew Q13_2 lobres grouptypebin insidergov age country sector) 
tab Q13_2, gen(aff_cat)

*Table D1: Summary of Variables in Final sample for the analysis (i.e. of organizations that have mobilised on Covid-19 related policies, excluding missings)
summarize Q20_1 timingnew i.Q13_2 i.lobres i.grouptypebin i.insidergov i.age i.country if Missing2==0

*Table D2: Correlation Matrix, n=960
corr timingnew aff_cat1 aff_cat2 aff_cat3 insidergov grouptypebin lobres_cat1 lobres_cat2 lobres_cat3 age_cat1 age_cat2 age_cat3 if Missing2==0

*Table D3: Summary of Lobbying Activity on Covid-19 issues
summarize Q8 if Missing2==0
summarize Q9_1 Q9_2 Q9_3 if Missing2==0

*Figure D1: Distribution of Perceived Influence over Covid-19 policy
hist Q20_1 if Missing2==0, percent xtitle (Influence on Coronavirus related policy (0 - 10))

*Figure D2: Distribution of the Timing of Mobilization
hist timingnew if Missing2==0, percent xtitle(Timing of Lobbying Activity) xlabel (1 "First Mover" 2 "Second Mover" 3 "Third Mover" 4 "Forth Mover" 5 "Last Mover", angle(45))

* Figure D3: Distribution of the Timing of Mobilization by Level of Affectedness
hist timingnew if Missing2==0, by(Q13_2, col(1) note("")) percent col(3) xtitle(Timing of Lobbying Activity) xlabel (1 "First Mover" 2 "Second Mover" 3 "Third Mover" 4 "Forth Mover" 5 "Last Mover", angle(45)) 

*Figure D4: Distribution of the Timing of Mobilization by Level of Resources
hist timingnew if Missing2==0, by(lobres, col(1) note("")) percent col(3) xtitle(Timing of Lobbying Activity) xlabel (1 "First Mover" 2 "Second Mover" 3 "Third Mover" 4 "Forth Mover" 5 "Last Mover", angle(45)) 

****
*Appendix E - further analysis details and robustness checks
****

*Table E1: OLS regressions explaining organizations' perceived influence on Coronavirus-related policies; with fixed effects for country and clustered standard errors for 13 different sectors – showing country coefficients
eststo: regress Q20_1 c.timingnew i.Q13_2 i.lobres i.grouptypebin i.insidergov i.age  i.country, vce(cluster sector)
eststo: regress Q20_1 c.timingnew##i.Q13_2  i.insidergov i.grouptypebin i.lobres i.age  i.country, vce(cluster sector)
eststo: regress Q20_1 c.timingnew##i.lobres i.Q13_2  i.insidergov i.grouptypebin i.age  i.country, vce(cluster sector)
** 
esttab using Table.rtf, replace wide nogap onecell cells(b(star fmt(%9.2f)) se(par)) r2(2) ///
		starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001)	///
        legend label collabels(none) 						///
		varlabels(_cons Constant i.lobres "Lobbying Resources" i.grouptype "Organisation Type" Q13 "Affectedness" i.age "Organisation Age" )
eststo clear 

*Table E2 - sector fixed effects: OLS regressions explaining organizations' perceived influence on Coronavirus-related policies; with fixed effects for sector and clustered standard errors for 10 different countries – showing sector coefficients
eststo: regress Q20_1 c.timingnew i.Q13_2 i.lobres i.grouptypebin i.insidergov i.age i.sector, vce(cluster country)
eststo: regress Q20_1 c.timingnew##i.Q13_2 i.lobres i.grouptypebin i.insidergov i.age i.sector, vce(cluster country)
eststo: regress Q20_1 c.timingnew##i.lobres i.Q13_2  i.insidergov i.grouptypebin i.age  i.sector, vce(cluster country)

esttab using Table.rtf, replace wide nogap onecell cells(b(star fmt(%9.2f)) se(par)) r2(2) ///
		starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001)	///
        legend label collabels(none) 						///
		varlabels(_cons Constant i.lobres "Lobbying Resources" i.grouptype "Organisation Type" Q13_2 "Affectedness" i.age "Organisation Age" )
eststo clear 

* Table E3 - OLS regressions explaining organizations' perceived influence on Coronavirus-related policies; with alternative measure for insider status on Covid-19- related policies and clustered standard errors for 13 different sectors
eststo: regress Q20_1 c.timingnew i.Q13_2 i.lobres i.grouptypebin i.contact i.age i.country, vce(cluster sector)
eststo: regress Q20_1 c.timingnew##i.Q13_2  i.contact i.grouptypebin i.lobres i.age  i.country, vce(cluster sector)
eststo: regress Q20_1 c.timingnew##i.lobres i.Q13_2  i.contact i.grouptypebin i.age  i.country, vce(cluster sector)

esttab using Table.rtf, replace wide nogap onecell cells(b(star fmt(%9.2f)) se(par)) r2(2) ///
		starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001)	///
        legend label collabels(none) 						///
		varlabels(_cons Constant i.lobres "Lobbying Resources" i.grouptype "Organisation Type" Q13_2 "Affectedness" i.age "Organisation Age" )
eststo clear 


*Table E4 - Analyses excluding low response countries (Italy, France, UK) - OLS regressions explaining organizations' perceived influence on Coronavirus-related policies; with fixed effects for country and clustered standard errors for 13 different sectors
eststo: regress Q20_1 c.timingnew i.Q13_2 i.lobres i.grouptypebin i.insidergov i.age  i.country if (country!=5 & country!=8 & country!=9), vce(cluster sector)
eststo: regress Q20_1 c.timingnew##i.Q13_2  i.insidergov i.grouptypebin i.lobres i.age  i.country if (country!=5 & country!=8 & country!=9), vce(cluster sector)
eststo: regress Q20_1 c.timingnew##i.lobres i.Q13_2  i.insidergov i.grouptypebin i.age  i.country if (country!=5 & country!=8 & country!=9), vce(cluster sector)

esttab using Table.rtf, replace wide nogap onecell cells(b(star fmt(%9.2f)) se(par)) r2(2)  ///
		starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001)	///
        legend label collabels(none) 						///
		varlabels(_cons Constant i.lobres "Lobbying Resources" i.grouptype "Organisation Type" Q13 "Affectedness" i.age "Organisation Age" )
eststo clear 


*Table E5 - Treating timing as a categorical variable - OLS regressions explaining organizations' perceived influence on Coronavirus related policies; with fixed effects for country and clustered standard errors for 13 different sectors
eststo: regress Q20_1 i.timingnew i.Q13_2 i.lobres i.grouptypebin i.insidergov i.age  i.country, vce(cluster sector)
eststo: regress Q20_1 i.timingnew##i.Q13_2  i.insidergov i.grouptypebin i.lobres i.age  i.country, vce(cluster sector)
eststo: regress Q20_1 i.timingnew##i.lobres i.Q13_2  i.insidergov i.grouptypebin i.age  i.country, vce(cluster sector)

esttab using Table.rtf, replace wide nogap onecell cells(b(star fmt(%9.2f)) se(par)) r2(2) ///
		starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001)	///
        legend label collabels(none) 						///
		varlabels(_cons Constant i.lobres "Lobbying Resources" i.grouptype "Organisation Type" Q13 "Affectedness" i.age "Organisation Age" )
eststo clear 

*Fig E1 - Predictions of the Level of Lobbying Influence for Early to Late Movers by Level of Affectedness (based on Model 2, Table E5), with 95% CIs. Treating timing as a quasi-categorical variable
/// figure is edited manually to exclude 'equally affected groups'
regress Q20_1 i.timingnew##i.Q13_2  i.insidergov i.grouptypebin i.lobres i.age  i.country, vce(cluster sector)

margins, at(timingnew=(1 2 3 4 5)) over(Q13_2) atmeans
marginsplot,  title("Early Mover Advantages by Affectedness") xtitle (Timing of Lobbying Activity)  recastci(rarea) yline(0)

*Fig E2 - Predictions of the Level of Lobbying Influence for Early to Late Movers by level of resources (based on Model 3, Table E5), with 95% CIs. Treating timing as a quasi-categorical variable
regress Q20_1 i.timingnew##i.lobres i.Q13_2  i.insidergov i.grouptypebin i.age  i.country, vce(cluster sector)

margins, at(timingnew=(1 2 3 4 5)) over(lobres) atmeans
marginsplot,  recastci(rarea) yline(0) title("Early Mover Advantages by Lobbying Staff Resources") xtitle (Timing of Lobbying Activity)


*Table E6 - Countries that introduced lockdown early and around the same time (ITA, IRE, AUT, GER, DK, FR ) - OLS regressions explaining organizations' perceived influence on Coronavirus-related policies; with fixed effects for country and clustered standard errors for 13 different sectors
eststo: regress Q20_1 c.timingnew i.Q13_2 i.lobres i.grouptypebin i.insidergov i.age  i.country if country!=2 & country!=9 & country!=6 & country!= 11, vce(cluster sector)
eststo: regress Q20_1 c.timingnew##i.Q13_2  i.insidergov i.grouptypebin i.lobres i.age  i.country if country!=2 & country!=9 & country!=6 & country!= 11, vce(cluster sector)
eststo: regress Q20_1 c.timingnew##i.lobres i.Q13_2  i.insidergov i.grouptypebin i.age  i.country if country!=2 & country!=9 & country!=6 & country!= 11, vce(cluster sector)

esttab using Table.rtf, replace wide nogap onecell cells(b(star fmt(%9.2f)) se(par)) r2(2)  ///
		starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001)	///
        legend label collabels(none) 						///
		varlabels(_cons Constant i.lobres "Lobbying Resources" i.grouptype "Organisation Type" Q13 "Affectedness" i.Q4 "Mobilisation Problem" i.age "Organisation Age" )
eststo clear 

**Table E7 - Countries that introduced lockdown late (SE, UK, NL5 ) - OLS regressions explaining organizations' perceived influence on Coronavirus-related policies; with fixed effects for country and clustered standard errors for 13 different sectors
eststo: regress Q20_1 c.timingnew i.Q13_2 i.lobres i.grouptypebin i.insidergov i.age  i.country if country==2 | country==9 | country==6, vce(cluster sector)
eststo: regress Q20_1 c.timingnew##i.Q13_2  i.insidergov i.grouptypebin i.lobres i.age  i.country if country==2 | country==9 | country==6, vce(cluster sector)
eststo: regress Q20_1 c.timingnew##i.lobres i.Q13_2  i.insidergov i.grouptypebin i.age  i.country if country==2 | country==9 | country==6, vce(cluster sector)

esttab using Table.rtf, replace wide nogap onecell cells(b(star fmt(%9.2f)) se(par)) r2(2)  ///
		starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001)	///
        legend label collabels(none) 						///
		varlabels(_cons Constant i.lobres "Lobbying Resources" i.grouptype "Organisation Type" Q13 "Affectedness" i.Q4 "Mobilisation Problem" i.age "Organisation Age" )
eststo clear 


***
*Appendix F - additional interaction plots
***

*Fig F1: Marginal Effect of Timing on Perceived Influence for Highly Affected Organizations compared to Less Affected Organizations (based on Model 2, Table 1, main article), with 95% CIs
regress Q20_1 c.timingnew##i.Q13_2  i.insidergov i.grouptypebin i.lobres i.age i.country, vce(cluster sector)

margins, dydx(i(0/2)Q13_2) at (timingnew=(1 2 3 4 5)) atmeans 
marginsplot, recast(line) recastci(rarea) yline(0) title("Early Mover Advantages by Affectedness Type:High compared to Low") xtitle (Timing of Lobbying Activity) legend (order(3 "Highly Affected"))
*manually edited to only show high affectedness compared to low

*Fig F2: Marginal Effect of Timing on Perceived Influence for High and Medium Resourceful Organizations compared to Organizations with Low Resources (based on Model 3, Table 1, main article), with 95% CIs
regress Q20_1 c.timingnew##i.lobres i.Q13_2  i.insidergov i.grouptypebin i.age  i.country, vce(cluster sector)

margins, dydx(i(1/3)lobres) at (timingnew=(1 2 3 4 5)) atmeans 
marginsplot, recast(line) recastci(rarea) yline(0) title("Early Mover Advantages by Lobbying Resources: High and Medium Resources compared to Low (Baseline)") xtitle (Timing of Lobbying Activity) legend(order (2 "Medium Resources" 3 "High Resources")) 


*** 
*Appendix G - Timing as a dependent variable and potential moderator
***

*Table G1 - Timing as a Dependent Variable – OLS (Model 1) and Ordered Logistic Regression (Model 2) explaining organizations' timing of lobbying on Coronavirus-related policies; with fixed effects for country and clustered standard errors for 13 different sectors
eststo: regress timingnew i.Q13_2 i.lobres i.grouptypebin i.insidergov i.age  i.country, vce(cluster sector)
eststo: ologit timingnew i.Q13_2 i.lobres i.grouptypebin i.insidergov i.age  i.country, vce(cluster sector)
esttab using Table.rtf, replace wide nogap onecell cells(b(star fmt(%9.2f)) se(par)) r2(2) pr2(2) ///
		starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001)	///
        legend label collabels(none) 						///
		varlabels(_cons Constant i.lobres "Lobbying Resources" i.grouptype "Organisation Type" Q13 "Affectedness" i.age "Organisation Age")
eststo clear 

*Table G2a - timing as potential mediator of the effect of affectedness on influence

eststo: sem (Q20_1<-Q13_2 timingnew) ( timingnew<-Q13_2), nocapslatent
esttab using Table2.rtf, replace wide nogap onecell cells(b(star fmt(%9.2f)) se(par))                ///
        stats(N chi2, fmt(%9.0g %9.0f %9.0f) labels("Number of Cases"))      ///
		starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001)	///
        legend label collabels(none) 						///
		varlabels(_cons Constant i.lobres "Lobbying Resources"  Q13_2 "Affectedness" timingnew "Timing" )
eststo clear 

*Table G2b - Significance testing of indirect effect of affectedness (unstandardised)
medsem, indep(Q13_2) med(timingnew) dep(Q20_1) mcreps(1000) rit rid

*Table G3a - Timing as potential mediator of the effect of Resources on Influence
eststo: sem (Q20_1<-lobres timingnew) ( timingnew<-lobres), nocapslatent
esttab using Table3.rtf, replace wide nogap onecell cells(b(star fmt(%9.2f)) se(par))                ///
        stats(N chi2, fmt(%9.0g %9.0f %9.0f) labels("Number of Cases"))      ///
		starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001)	///
        legend label collabels(none) 						///
		varlabels(_cons Constant i.lobres "Lobbying Resources"  Q13_2 "Affectedness" timingnew "Timing" )
eststo clear 

*Table G3b -  Significance testing of indirect effect of resources (unstandardised)
medsem, indep(lobres) med(timingnew) dep(Q20_1) mcreps(1000) rit rid

